#ifndef LW_EDGE_ACCESS_LIST_H
#define LW_EDGE_ACCESS_LIST_H

#include "List.h"

/**
 * The base container for lists that have only access to the first or last elements.
 * (abstract)
 */
template<typename T>
class EdgeAccessList : public List<T> {
public:

    virtual ~EdgeAccessList() {
    }

    /**
     * Adds the specified element to this list.
     */
    virtual inline List<T>& operator<<(const T& e) {
        Push(e);
        return *this;
    }

    /**
     * Retrieves and removes an element from this list.
     */
    virtual inline EdgeAccessList& operator>>(T& e) {
        Pop(e);
        return *this;
    }

    /**
     * Removes all elements from this list.
     */
    virtual inline void Clear() {
        while (!this->Empty()) {
            Pop();
        }
    }

    /**
     * Adds the specified element to this list.
     */
    virtual inline void Push(const T& e) = 0;

    /**
     * Removes an element from this list.
     */
    virtual inline void Pop() = 0;

    /**
     * Retrieves and removes an element from this list.
     */
    virtual inline void Pop(T& e) = 0;

};

#endif //LW_EDGE_ACCESS_LIST_H
